/*package com.qiaoya.web.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.qiaoya.model.dto.JsonResult;
import com.qiaoya.model.dto.SelfservitemDto;
import com.qiaoya.model.entity.Gov_publishEntity;
import com.qiaoya.model.entity.MallitemEntity;
import com.qiaoya.model.entity.MarservitemEntity;
import com.qiaoya.model.entity.ServitemmainEntity;
import com.qiaoya.model.entity.ServitemsubEntity;
import com.qiaoya.service.FamilyPensionService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@Api(value = "VitaltyPension", produces = MediaType.APPLICATION_JSON_VALUE)
@RestController
@RequestMapping("api/v1/VitaltyPension")
//活力养生
public class VitalityPensionController {

	@Autowired
	protected FamilyPensionService familyPensionService; 
	// 初始化获取二级三级目录

			@ApiOperation(value = "活力养生多级目录列表", notes = "活力养生多级目录列表", produces = MediaType.APPLICATION_JSON_VALUE)
			@GetMapping("/dirs")
			public JsonResult<Object> getDirsList(
					HttpServletResponse response ) {
				//一级目录名称
				String MainName ="活力养生";
				JsonResult<Object> ResultJson = new JsonResult<Object>(null);
				List<ServitemmainEntity> maindirList = familyPensionService.SelServitemmainList(MainName,4);
				List<ServitemsubEntity> subdirList = familyPensionService.SelServitemsubList(MainName,4);
				JSONArray myjson = new JSONArray();
				for(ServitemmainEntity itemmain :maindirList){
					String mainId = itemmain.getServItemMain_ID();
					JSONObject mainObj = new JSONObject();
					JSONArray jsonArray = new JSONArray();
					for(ServitemsubEntity itemsub :subdirList){
						if(itemsub.getServItemMain_ID().equalsIgnoreCase(mainId)){
							JSONObject subObj = new JSONObject();
							subObj.put("subId", itemsub.getServItemSub_ID());
							subObj.put("subName", itemsub.getServItemName());
							jsonArray.add(subObj);
						}
					}
					mainObj.put("mainId", itemmain.getServItemMain_ID());
					mainObj.put("mainName", itemmain.getServItemName());
					mainObj.put("topName", MainName);
					mainObj.put("servClass", itemmain.getServClass());
					mainObj.put("sublist", jsonArray);
					myjson.add(mainObj);
				}
				ResultJson = new JsonResult<Object>(myjson);
				response.setHeader("Access-Control-Allow-Origin", "*");
				response.setHeader("Access-Control-Allow-Methods", "POST");
				response.setHeader("Access-Control-Allow-Headers", "x-requested-with,content-type");
				return ResultJson;
			}
			
			

}
*/